[Go] Fix for #4342--EmitToken(token) in Go target needs to be exported#4343
Open
[Go] Fix for #4342--EmitToken(token) in Go target needs to be exported#4343
Conversation
…. Required for porting https://github.com/antlr/grammars-v4/tree/master/python/python3 to the Go target. This change just mirrors the APIs for the other targets, like Java, CSharp, and JavaScript/TypeScript. Signed-off-by: Ken Domino <kenneth.domino@domemtech.com>
This was referenced Jul 3, 2023
teverett
pushed a commit
to antlr/grammars-v4
that referenced
this pull request
Jul 8, 2023
* Fixes for #3539 Typescript cannot work because the declaration of the constructor for CommonToken() is wrong. * Fix python/python3/TypeScript * Remove grammars that only add to confusion. * Update Dart port, but this cannot work because Antlr 4.13.0 Dart runtime missing types. * Add Dart port for python3 grammar. This base class for Dart works, but requires changes to Antlr. antlr/antlr4#4321 * Updates, but incomplete, for Cpp. * Additional changes. * Updates to get Cpp target to link. * Changes for working Cpp target. * Add in Cpp to workflow. * Updates. * Adjust to for rebuild. * Remove bothersome tabs from source code. * Rename tests into "small" and "large" tests to reflect that "slow parsers work on the small test suite". * Fix names of test directories in desc.xml. * Update for Go target. Remove python3-cpp. * Getting Go target compiling--does not work yet. * Fixes for Go target of python3 grammar. This port works but only if the Go runtime is fixed, and "Virt" is assigned in the driver. See antlr/antlr4#4343 antlr/antlr4#4342 * Fix desc.xml
rvrooman-codelogic
pushed a commit
to CodeLogicIncEngineering/grammars-v4-public-fork
that referenced
this pull request
Jul 27, 2023
* Fixes for antlr#3539 Typescript cannot work because the declaration of the constructor for CommonToken() is wrong. * Fix python/python3/TypeScript * Remove grammars that only add to confusion. * Update Dart port, but this cannot work because Antlr 4.13.0 Dart runtime missing types. * Add Dart port for python3 grammar. This base class for Dart works, but requires changes to Antlr. antlr/antlr4#4321 * Updates, but incomplete, for Cpp. * Additional changes. * Updates to get Cpp target to link. * Changes for working Cpp target. * Add in Cpp to workflow. * Updates. * Adjust to for rebuild. * Remove bothersome tabs from source code. * Rename tests into "small" and "large" tests to reflect that "slow parsers work on the small test suite". * Fix names of test directories in desc.xml. * Update for Go target. Remove python3-cpp. * Getting Go target compiling--does not work yet. * Fixes for Go target of python3 grammar. This port works but only if the Go runtime is fixed, and "Virt" is assigned in the driver. See antlr/antlr4#4343 antlr/antlr4#4342 * Fix desc.xml
Member
|
@jimidle ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for #4342.
This change is required for porting https://github.com/antlr/grammars-v4/tree/master/python/python3 to the Go target.
This change adds
EmitToken(token)to the type interface for lexers. It's required because it's available--and used!!--in all the other targets. In addition, the call toEmitToken(token)must be "virtualized", which is accomplished usingb.Virt.EmitToken(token). TheVirtfield is set prior to calling the parse in the driver code.This change is a fix to what is just a terrible, terrible hack. A v-table call should have never been implemented this way!